Control hiding of hideable views embedded in the displayed text. If hiding is requested, all views that have a preference hideable will be suppressed, i.e. reduced to zero width and zero height. For example, this is used to selectively hide or show rulers in a text.
If v.context # NIL and ~v.context.Normalize(), this is an operation.
v.HidesMarks() = hide
PROCEDURE (v: View) HidesMarks (): BOOLEAN
Interface
Current status: Whether view hides hideable views, or not.
Locates a reference frame displaying v and performs v.ShowRangeIn on it. If ~focusOnly, an arbitrary frame will be taken, where a target frame takes precedence over all but a front frame, which takes precedence over all other frames. If focusOnly, only a front (or if none exists, a target) frame is taken as a reference, and no repositioning takes place if neither a target nor a front frame is found.
TYPE Directory
Interface
Directory for views.
defAttr-: TextModels.Attributes
Default attributes, used for initial formatting when typing to an empty text.
PROCEDURE (d: Directory) Set (defAttr: TextModels.Attributes)
Default
Set the default attributes.
defAttr # NIL 20
defAttr.init 21
d.defAttr = defAttr
PROCEDURE (d: Directory) New (text: TextModels.Model): View
Interface
Return a new view displaying text.
PROCEDURE (d: Directory) StdNew () : View
Default
Except for performance, equivalent to:
RETURN d.New(TextModels.dir.New())
TYPE Location
Characteristics of an element's (i.e. a character's or embedded view's) location in a text view.
start, pos: LONGINT
Start of line and position of location.
x, y: LONGINT
Coordinates of location.
asc, dsc: LONGINT
Line's ascender and descender at location.
view: Views.View
l, t, r, b: LONGINT
If embedded view at location: The view and its bounding box.
TYPE PositionMsg
Message broadcast by ShowRange to request repositioning.
focusOnly: BOOLEAN
Reposition front (or, if none, target) view only.
beg, end: LONGINT
The range requested to become visible.
VAR ctrlDir-: Containers.Directory stable ctrlDir # NIL
Controller directory object. If installed, this directory object is used by the view directory object to install a controller in a newly created view. Upon initialization, module TextViews tries to load module TextControllers which, if available, in turn installs the standard controller directory object in ctrlDir.
VAR dir-, stdDir-: Directory dir # NIL, stdDir # NIL, stable stdDir = d
Directory and standard directory objects for views.
PROCEDURE SetCtrlDir (d: Containers.Directory)
Set controller directory object.
d # NIL 20
ctrlDir = d
PROCEDURE SetDir (d: Directory)
Set directory object.
d # NIL 20
dir = d
PROCEDURE Focus (): View
Return focus text view, if one exists.
Except for performace, equivalent to:
VAR v: Views.View;
v := Controllers.FocusView();
IF (v # NIL) & (v IS View) THEN RETURN v(View) ELSE RETURN NIL END
PROCEDURE FocusText (): TextModels.Model
Return focus text, if one exists.
Except for performace, equivalent to:
VAR v: View;
v := Focus();
IF v # NIL THEN RETURN v.ThisModel() ELSE RETURN NIL END